<?php
/**
 * Created by PhpStorm.
 * User: fanzhaogui
 * Date: 2021/4/8
 * Time: 11:14
 */

require_once 'vendor/autoload.php';

$config = new \EasySwoole\Mysqli\Config([
    'host'     => '127.0.0.1',//防止报错,就不切换数据库了
    'port'     => '3306',
    'user'     => 'root',//数据库用户名
    'password' => '123456',//数据库密码
    'database' => 'test',//数据库
    'timeout'  => '5',
    'charset'  => 'utf8',
]);

$client = new \EasySwoole\Mysqli\Client($config);

go(function () use ($client) {
    // 构建sql
    $client->queryBuilder()
        ->get('user_list');

    // 执行sql
    var_dump($client->execBuilder());
});